package main

import (
	"fmt"
	"encoding/json"
)

type Monster struct {
	Age int
	Name string
}

func unmarshalStruct() {

	str := "{\"Age\": 500, \"Name\": \"Jack\"}"
	var monster Monster
	err := json.Unmarshal([]byte(str), &monster)
	if err != nil {
		fmt.Println("err:", err)
		return
	}
	fmt.Println(monster)

}

func main() {

	unmarshalStruct()

}